home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ARASAN_S.ZIP / MOVEGEN.H < prev    next >
C/C++ Source or Header  |  1993-11-17  |  1KB  |  49 lines

  1. // Copyright 1992 by Jon Dart.  All Rights Reserved.
  2.  
  3. #ifndef _MOVE_GENERATOR_H
  4. #define _MOVE_GENERATOR_H
  5.  
  6. #include "board.h"
  7. #include "constant.h"
  8. #include "move.h"
  9.  
  10. class Move_Generator
  11. {
  12.     public:
  13.         
  14.         enum {MaxMoves = 75};        
  15.         
  16.     Move_Generator( const Board &ABoard, const unsigned ply,
  17.        const Move &last_move );
  18.     ~Move_Generator();
  19.     
  20.     int Generate_Moves( Move *moves, const Boolean captures_only = False,
  21.         const Boolean repeatable = False );
  22.     // fills array "moves" with moves, returns # of moves (0 if
  23.         // no more).  If repeatable = True, generate moves in a predictable
  24.         // order.  If captures_only = True, generate capture moves only
  25.         // (ignored if the side to move is in check).
  26.         //         
  27.         // The moves returned are generally "pseudo-legal", i.e. they may
  28.         // involve moves into check.  However, if the side to move is in
  29.         // check, all moves returned are strictly legal.        
  30.         
  31.     private:
  32.         
  33.     int my_ply;
  34.     Move my_last_move;
  35.     const Board &board;
  36.  
  37.     inline void SetMove( const Square source, const Square dest,
  38.         const Piece::PieceType promotion,
  39.         Move *moves, unsigned &NumMoves);
  40.  
  41.     unsigned Check_Evasions( Move *moves );
  42.     // returns a list of the moves that may be used to escape
  43.         // check.  Unlike the regular move generation routine, all
  44.         // moves are checked for legality.
  45.         
  46. };
  47.  
  48. #endif
  49.